package com.yuanfeng.business.controller;

import com.yuanfeng.business.dto.UserTokenBeanDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName ShopAgreementRuleController
 * @Description
 * @Author hyq
 * @Date 2023/8/8 14:03
 * @Version 1.0
 **/
@RestController
@RequestMapping("/shop/agreementRule")
public class ShopAgreementRuleController extends BaseController{

    /**
     * 查询协议内容
     *
     * @param map
     * @return
     */
    @PostMapping("/content/query")
    public ResponseResult queryAgreementContent(@RequestBody Map<String, Object> map) {
        ResponseResult result=shopAgreementRuleService.queryAgreementContent(map);
        return result;

    }


    /**
     * 查询店铺参与的协议列表
     *
     * @param param
     * @return
     */
    @PostMapping("/join/agreeList")
    public ResponseResult queryShopJoinAgreeList(@RequestBody UserTokenBeanDTO param) {
        ResponseResult result=shopAgreementRuleService.queryShopJoinAgreeList(param);
        return result;
    }


    /**
     * 查询最新店铺协议
     *
     * @param
     *
     */
    @PostMapping("/query/newAgreement")
    public ResponseResult queryNewAgreement() {
        ResponseResult result=shopAgreementRuleService.queryNewAgreement();
        return result;
    }

}
